package com.jake.microservice.provider.mybatis.mapper;

import com.jake.microservice.model.UserDTO;
import com.jake.microservice.model.UserInfoDTO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserMapper {

    List<UserDTO> findAllUsers();

    List<UserDTO> findAllUserInfo();

    UserDTO findUserById(Integer uid);

    UserInfoDTO findUserInfoById(Integer uid);

    List<UserInfoDTO> findUserInfoByUsernameAndCname(@Param("username") String username, @Param("cname") String cname);

    UserDTO findUserByName(@Param("username") String username);

    int insertUser(UserDTO user);

    int updateUser(UserDTO user);

    int updateUsername(String username, Integer uid);

    int deleteUserById(Integer uid);
}
